#include "FluidBB.h"

////////////////////////////////////////
// Building block
////////////////////////////////////////
void clear_data ( void );

int Clear(const CKBehaviorContext& behcontext)
{
	CKBehavior* beh = behcontext.Behavior;

	beh->ActivateInput(0, FALSE);	// deactivation

	clear_data();
	beh->ActivateOutput(0);

	return (CKBR_OK);
}

CKERROR CreateClearProto ( CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("Clear");

	if(!proto)
		return (CKERR_OUTOFMEMORY);

	proto->DeclareInput("In");
	proto->DeclareOutput("Out");

	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetFunction(Clear);
	//proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);

	*pproto = proto;
	return (CK_OK);
}

CKObjectDeclaration *FillBehaviorClear()
{
	CKObjectDeclaration *od = CreateCKObjectDeclaration ( "Clear" );
	od->SetDescription ( "Clears the velocity and density fields." );
	od->SetCategory ( "Fluids" );
	od->SetType ( CKDLL_BEHAVIORPROTOTYPE );
	od->SetGuid ( CLEAR_GUID );
	od->SetAuthorGuid ( AUTHOR_GUID );
	od->SetAuthorName ( "Jonathan DERROUGH" );
	od->SetVersion ( 0x00000001 );
	od->SetCreationFunction ( CreateClearProto );
	//od->SetCompatibleClassId ( CKCID_3DENTITY );
	return od;
}
